<template>
    <van-nav-bar
        title="砍价列表"
        left-arrow
        @click-left="$router.back()"
    />
    <div>
        <bargin-card v-for="item in state.goodsMap" :key="item.id" :bargin="item"></bargin-card>
    </div>
</template>
<script>
import { getBargins } from '@/api'
import { reactive } from 'vue'
import barginCard from '@/components/barginCard/barginCard'
export default {
    components: {
        barginCard
    },
    setup() {
        // 请求砍价列表数据
        const state = reactive({
            goodsMap: {}
        })
        getBargins().then(res => {
            // console.log(res);
            state.goodsMap = res.goodsMap
        })

        return {
            state
        }
    }
}
</script>